﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$CalendarDBConnection$" formatter="bizobjlist of User">
	<Sql >
		SELECT
			Users.id, Users.userName, 
			Contacts.id AS contact_id, Contacts.lastName AS contact_lastName, Contacts.firstName AS contact_firstName, 
			Contacts.middleName AS contact_middleName, Contacts.phone as contact_phone, Contacts.email as contact_email,
			Contacts.typeId as contact_typeId
		FROM
			Users 
			INNER JOIN Contacts ON Users.id = Contacts.id 
			INNER JOIN CalendarEventEnrolled ON Users.id = CalendarEventEnrolled.userId
		WHERE
			(CalendarEventEnrolled.eventId = @eventId)
	</Sql>
	<Param name="eventId" type="UniqueIdentifier" />
</AdoNetDataAccess>
